package com.woniu.outlet.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class RedisEquipmentRepo {
    @Autowired
    private StringRedisTemplate redisTemplate;


    public String findEquipments(String key) {
        BoundValueOperations<String,String> ops = redisTemplate.boundValueOps(key);
        String str = ops.get();
        return str;
    }

    public void saveEquipment(String key,String str){
        BoundValueOperations<String,String> ops = redisTemplate.boundValueOps(key);
        ops.set(str);
    }

    public void deleteEquipment(String key) {
        redisTemplate.delete(key);
    }

    public String findEquipmentStops(String key) {
        BoundValueOperations<String,String> ops = redisTemplate.boundValueOps(key);
        String str = ops.get();
        return str;
    }

    public void saveEquipmentStop(String key, String str) {
        BoundValueOperations<String,String> ops = redisTemplate.boundValueOps(key);
        ops.set(str);
    }

    public void deleteEquipmentStop(String key) {
        redisTemplate.delete(key);
    }

    public String findEnergys(String key) {
        BoundValueOperations<String,String> ops = redisTemplate.boundValueOps(key);
        String str = ops.get();
        return str;
    }

    public void saveEnergy(String key, String str) {
        BoundValueOperations<String,String> ops = redisTemplate.boundValueOps(key);
        ops.set(str);
    }

    public void deleteEnergy(String key) {
        redisTemplate.delete(key);
    }
}
